#添加元素

demo_set = set()
demo_set.add('py')
demo_set.update('thon')
demo_set.add('py')
print(demo_set)

# #删除元素
# remove_set = {'red', 'green', 'black'}
# remove_set.remove('red')
# print(remove_set)
# remove_set.remove('blue')
# print(remove_set)

discard_set = {'python', 'php', 'java'}
discard_set.discard('java')
discard_set.discard('ios')
print(discard_set)

#清空元素
clear_set = {'red', 'green', 'black'}
clear_set.clear()
print(clear_set)

#操作符"|"
set_a = {'a', 'c'}
set_b = {'b', 'c'}
print(set_a | set_b)

#"&"
print(set_a & set_b)

#-
print(set_a - set_b)
print(set_b - set_a)

#^
print(set_a ^ set_b)
